﻿using Common.Communal;
using ERP.Domain.CustomerSupplier;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Sell.Api.Read.Application.Command.GoodCommand;
using Sell.DTO;

namespace Sell.Api.Read.Controllers.Good
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class GoodController : ControllerBase
    {
        public IMediator mediator { get;}
        public GoodController(IMediator _mediator)
        {
            mediator = _mediator;
        }
        /// <summary>
        /// 货品信息列表
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        [HttpGet]
        public async Task<ApiResult<ApiPaging<gooddto>>> Goodlist([FromQuery]GoodlistCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
